//
//  UINavigationController+AG.swift
//  BWExtensionKit
//
//  Created by zhuxuhong on 2022/2/21.
//

import UIKit

extension UINavigationController {
    public func popVC(animated: Bool = true, completion: (() -> Void)? = nil) {
        CATransaction.begin()
        CATransaction.setCompletionBlock(completion)
        popViewController(animated: animated)
        CATransaction.commit()
    }
    
    public var rootViewController: UIViewController? {
        return viewControllers.first
    }
}
